//
//  ViewController.m
//  TSTest
//
//  Created by TongShuai on 12-9-4.
//  Copyright (c) 2012年 TongShuai. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize btn1,btn2;

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    [btn1 setTitle:@"Normal" forState:UIControlStateNormal];
    [btn1 setTitle:@"Highlighted" forState:UIControlStateHighlighted];
    [btn1 setTitle:@"Selected" forState:UIControlStateSelected];
    [btn1 addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [btn2 setTitle:@"Normal" forState:UIControlStateNormal];
    [btn2 setTitle:@"Highlighted" forState:UIControlStateHighlighted];
    [btn2 setTitle:@"Selected" forState:UIControlStateSelected];
    [btn2 addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    NSLog(@"%@",@"2le");
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (void)btnAction:(id)sender
{
    UIButton *btn = (UIButton*)sender;
    btn.selected = !btn.selected;
}

@end
